package com.lsa.letcode.the58.lengthLastWord;

import static org.junit.Assert.*;

import org.junit.Test;

public class LengthLastWordTest {
	@Test
	public void testName() throws Exception {
		Solution s = new Solution();
		assertEquals(5, s.lengthOfLastWord(" 12 123 1234   12345 "));
		assertEquals(0, s.lengthOfLastWord("  "));
		assertEquals(1, s.lengthOfLastWord(" a "));
		assertEquals(1, s.lengthOfLastWord("a"));
		assertEquals(1, s.lengthOfLastWord(" a a "));
		assertEquals(1, s.lengthOfLastWord(" a a a "));
		assertEquals(0, s.lengthOfLastWord(""));
		assertEquals(5, s.lengthOfLastWord("12345"));
		assertEquals(1, s.lengthOfLastWord(" a ab 123 ab a "));
		assertEquals(3, s.lengthOfLastWord(" a ab 123 ab a 123"));
	}
}
